package entities;
import java.sql.Date;

import DAL.UserMakesVoteDA;
import DAL.VotingDA;

public class Voting {
	private int adminID;
	private int votingID;
	private Date startDate;
	private Date endDate;
	private String questions;
	private int votingGroup;
	private int numberOfVoters ;
	private String whoCanVoteQuery ;
	private String privateKey ;
	private String publicKey ;
	private String result;
	public Voting(){
		adminID = -1;
		votingID = -1;
		startDate = null;
		endDate = null;
		questions = "";
		votingGroup = -1;
		numberOfVoters  = -1;
		whoCanVoteQuery = "";
		privateKey = "";
		publicKey = "";
		result="";
	}
	public String getResult() {
		return result;
	}
	public void setResult(String result) {
		this.result = result;
	}
	public void setAdminID(int adminID) {
		this.adminID = adminID;
	}
	public int getAdminID() {
		return adminID;
	}
	public void setVotingID(int votingID) {
		this.votingID = votingID;
	}
	public int getVotingID() {
		return votingID;
	}
	@SuppressWarnings("deprecation")
	public void setStartDate(int year, int month , int day) {
		this.startDate = new Date(new java.util.Date(year + "/" + month +"/" +day).getTime());
	}
	public void setStartDate(long time) {
		this.startDate = new Date(time);
	}
	public Date getStartDate() {
		return startDate;
	}
	@SuppressWarnings("deprecation")
	public void setEndDate(int year, int month , int day) {
		this.endDate = new Date(new java.util.Date(year + "/" + month +"/" +day).getTime());
	}
	public void setEndDate(long time) {
		this.endDate = new Date(time);
	}
	public Date getEndDate() {
		return endDate;
	}
	public void setQuestions(String questions) {
		this.questions = questions;
	}
	public String getQuestions() {
		return questions;
	}
	public String toString(){
		return "( " + adminID + " , " +votingID + " , "+ startDate + " , " + 
		endDate + " , " +  questions + " )";
	}
	public void setVotingGroup(int votingGroup) {
		this.votingGroup = votingGroup;
	}
	public int getVotingGroup() {
		return votingGroup;
	}
	public void setNumberOfVoters(int numberOfVoters) {
		this.numberOfVoters = numberOfVoters;
	}
	public int getNumberOfVoters() {
		return numberOfVoters;
	}
	public void setWhoCanVoteQuery(String whoCanVoteQuery) {
		this.whoCanVoteQuery = whoCanVoteQuery;
	}
	public String getWhoCanVoteQuery() {
		return whoCanVoteQuery;
	}
	public void setPrivateKey(String privateKey) {
		this.privateKey = privateKey;
	}
	public String getPrivateKey() {
		return privateKey;
	}
	public void setPublicKey(String publicKey) {
		this.publicKey = publicKey;
	}
	public String getPublicKey() {
		return publicKey;
	}
}
